package models

import (
	"log"
	"os"

	"github.com/go-xorm/xorm"
)

var engine *xorm.Engine

// InitEngine 初始化数据库
func InitEngine(host string) {
	var err error
	engine, err = xorm.NewEngine("mysql", host)
	if err != nil {
		log.Println("connect to database error ： ", err)
		os.Exit(1)
	}
	log.Println("connect to database successful")
}
